<!DOCTYPE html>
<html lang="en">
<%
var categoryName = "";
var cName = "";
if(category==1){
categoryName="野生动物";
cName="动物";
}else{
categoryName="野生植物";
cName="植物";
}
layout("/common/_body.html",{title:categoryName}){
%>


<body>
<!-- 页面头部 -->
<div class="header">
    <div class="header_wrap">
        <div class="header_lt">
            <h3>武汉市森林公安大数据平台</h3>
        </div>
        <%
        layout("/common/_bar.html"){}
        %>

    </div>
</div>
<!-- 中间区域 -->
<div class="main">
    <div class="banWrap" style="background-image: url('${category==1?'/static/img/animalBan.png':'/static/img/botanyBan.png'}')">
        <h3>${category==1?'野生保护动物':'野生保护植物'}</h3>
        <%
        var url ="";
        if(category==1){
                url = "/web/animal";
        }else{
        url = "/web/plant";
        }
        %>
        <form action=${url}?current=1" method="get">
        <div class="search_form clearfix">
            <div class="searchBox fl">
                <input name="name" value="${name!}" class="search_text" type="text"/>
            </div>
            <div onclick="search()" class="search_Btn fl">查找</div>
        </div>
        </form>
    </div>
    <style>
        .screen_list li.active a{
            color: #FFFFFF;
        }

        .screen_wrap >ul >li >a{
            color: #0D6768;
        }
        /*.screen_wrap >ul >li >a:hover{*/
            /*color: white;*/
        /*}*/
    </style>
    <div class="screen_wrap">
        <%
            if(category==1){
        %>
               <ul class="screen_list clearfix">
                   <% var t = type!'0';  %>
                   <li class="${t=='0'?' active':''}"><a  href="/web/1" >全部</a></li>
                   <li  class="${t=='1'?'active':''}"><a href="/web/1?type=1">一级保护动物</a></li>
                   <li  class="${t=='2'?'active':''}"><a href="/web/1?type=2">二级保护动物</a></li>
                   <li  class="${t=='3'?'active':''}"><a href="/web/1?type=3">三级保护动物</a></li>
               </ul>
        <%   }else{
        %>
              <ul class="screen_list clearfix">
                  <% var t = type!'0';  %>
                  <li class="${t=='0'?'active':''}"><a  href="/web/2" >全部</a></li>
                  <li  class="${t=='1'?'active':''}"><a href="/web/2?type=1">一级保护植物</a></li>
                  <li  class="${t=='2'?'active':''}"><a href="/web/2?type=2">二级保护植物</a></li>
                  <li  class="${t=='3'?'active':''}"><a href="/web/2?type=3">三级保护植物</a></li>
              </ul>
        <%}%>


        <ul class="wild_list clearfix">
            <%
                for(a in animal.records){
             %>
                <%
                    var typeName = "";
                    if(a.type==1){
                       typeName="国家一级保护"+cName;
                     }else if(a.type==2){
                        typeName  =  "国家二级保护"+cName;
                     }else{
                        typeName  =  "国家三级保护"+cName;
                     }
                 %>
                <li>
                    <div class="intImg" style="background-image: url('${a.textImgs}')"></div>
                    <div class="intro">
                        <h3 class="name ellips">${a.name!}</h3>
                        <p class="content">${a.textDesc!}</p>
                        <p class="nature">属性：${typeName}</p>
                    </div>
                </li>
            <%
                }
            %>
        </ul>
        <!--分页-->
        <div class="pagination">
            <a href="/web/1?current=1" class="first">首页</a>
            <a href="/web/1?current=${animal.current==1?'1':animal.current-1}" class="next">上一页</a>
            <%
                for(var i = 1;i<=animal.pages;i++){
            %>
               <a class="${i==animal.current?'current':''}" href="/web/1?current=${i}">${i}</a>
            <%
               }
            %>
            <a href="/web/1?current=${animal.current>=animal.pages?animal.pages:animal.current+1}" class="next">下一页</a>
            <a href="/web/1?current=${animal.pages}" class="last">末页</a>
        </div>
        <!--分页 end-->
    </div>
</div>

<!-- 页面底部 -->
<div class="footer">
    <div class="footer_wrap">武汉市森林公安局版权所有</div>
</div>

<%}%>

<script>
    function search(){
        $("form").submit();
    }

</script>
</body>
</html>
